var main = new Vue({
	el: '#main',
	data: {
		user: JSON.parse(localStorage.user_info || '{}'),
		order: JSON.parse(sessionStorage.service_order || '{}'),
		tcshow: false,
		ios: iosipone,
		workerGender: JSON.parse(localStorage.user_info || "{}").gender, //性别
		workerIcon:JSON.parse(localStorage.user_info||"{}").headIcon || "",//头像
		ip:localStorage.ip,
	},
	methods: {
		pingjiadj: function(numb) {
			if(this.order.ordertype == 3) {
				this.order.pjdj = numb;
			}
		},
		cancelorder: function() {
			this.tcshow = false;
		},
		evaluation: function() {
			if(this.order.pjnr == '' || this.order.pjnr == null) {
				layer.open({
					content: '评价内容不能为空，必须填写',
					btn: '我知道了'
				});
			}else{
				pingjia(this.order.pjdj, this.order.pjnr, this)
			}
		},
		telipon: function(ipon) {
			console.log("调用iOS方法" + ipon)
			secondClick(ipon)
		}
	}
})

function pingjia(level, discuss, _this) {
	ajaxPost(
		Url.FWORDER_EVALUATE, {
			"orderId": main.order.orderId,
			"level": level,
			"discuss": discuss
		},
		function(data) {
			console.log(data)
			log_message("评价成功");
			this.tcshow = false;
			window.history.go(-1);
		}
	)
}
if(iosipone) {
	document.getElementById("iosbox").setAttribute("style", "top: 18px;")
	document.getElementById("iosbox2").setAttribute("style", "position: fixed;top: 0px;left: 0px;height: 18px;width:100%;background: #698af3;")
}
document.getElementById("main").setAttribute("style", "display: block;")